package com.example.androidcomplete0102.ch13;

import com.example.androidcomplete0102.R;

import android.app.Activity;
import android.os.Bundle;
import android.widget.CalendarView;
import android.widget.Toast;

public class CalendarViewEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_calendarview);
		
		CalendarView calendar =(CalendarView)findViewById(R.id.calendar);
		calendar.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
			
			@Override
			public void onSelectedDayChange(CalendarView view, int year, int month,
					int dayOfMonth) {
				Toast.makeText(CalendarViewEx.this, ""+year+"/"+(month+1)+"/"+dayOfMonth, 0).show();
				
			}
		});
	}
}
